fix bug with opening the deleted file