added database quering to page