Respond gracefull to shutdown