name spacing query and replacing some of it