buy and sell fix + logging