fixed write after process.exit