wait for all input shutdown gracefully