fixed bug, when exception while deleting a file