fixed minor exit bug