Fixed deleting bug with files