handleProgramChange procedure bug fix