created exit helper
fixed bug