fixed a bug when deleting folders