add $watch code