fixed program closing