throw exception when failed to delete file