adding query program