modified exit bug