fix bug that barY maxY dont update