Bugfix to delete directory