fix a small bug in the main app code