modified program_b signal control routine