switch watch function