Revert "fixed program closing"

This reverts commit a5cb69ea1f365bf474464c92b45051b44c97aa39.