Fix a bug that when user deletes the project, it will navigate to a
non-existed page.
Fix a bug that if the project is not empty, it can't be deleted.