improve drawing and thread safety