bugfix around gracefulstop