add test for purchase by reference