fix not shutting down bug