Bugfix when deleting folders