important buy.cpp fix