fixed program stopping