420142 reimplemented graceful shutdown