fix the bug when resize to change barLoc