checks if user is logged in when calling actions