adding query and foundation