changed query in buy