Fix bug with redrawing