delegate method
know the values of the ui switch changes