Fix redrawing bug