Tried a different method of getting the count.

There was an issue with some users where it wasn't counting them as
logged inwhen it made the AJAX call resulting in a forward to the login
screen.
Replaced exception for view errors