fixed some bugs regarding color