change gratuity to userGratuity in query