added necessary methods for the on/off switch