Solved issue from before with $apply and $timeout