added database query to main page