Fix programm state trace bug