Add groups query when logging in