I think you should find a way to give a value to var ch1. As it is it will get a random number on startup.

Ioannis