fixed hang-up at end of program