fix can't exit bug