fixed a bug of kline calculation