fix bug that barY maxY don't change