fixed that annoying exit bug