fix bug: error after deleting file