updated shutdown hook and added menu option to shutdown from server