fixed shutdown to cleanup all data