controlling the existance of the document when removing