fixed bug in deleting a correct file