fixed bug that the color of preview does not change