fixed a bug in style change