fixed deadlock error with updateColor function