added method to check if user is authenticated