fixing a bug when deleting file (double directory)