added context to onLoggedIn