make it also check that the user is logged in; eliminates need to type `isLoggedIn()` on the previous line