Make sure we only repaint on the UI thread