$timeout AngularJS fix