Fixed closing after deleting a file