add exit routine