checking if user is authenticated