Wrap $scope.$apply in $timeout due to weird bug