added database queries