change write, add 'exit'