fix to do shutdown (without process.exit())