adding query to the DB