fixed a trading bug