Moved around queries in do purchase