#38 checking if isAuthenticated is available before calling