add exit method.