Thread for repainting added