I have tried the code change at below location:
Also made sure the clock to the switch is properly connected.