added a watch function