Fixed a small bug regarding not pausing at end of program