add exit
refactor