fixed a bug with the scale bar