added code to watch changes of the angular model