fix the bug that barY not update