Added the check if current program is being deleted