Adds conditional printing of state variable