Fix exceptions while redraw. Multiply threads causes race conditions and not atomic operations