Hack to avoid error on redraw