clear on repaint
potential threading fix
improve exception handling