fixed a minor exit bug