include $apply to stay within the ng event listener