buy and sell error fix