fix bug where labels sometimes are the wrong color