ENH: updated shutdown with status code