fix js color msg race condition