added support for checking for authenticated user.