fix bug on rotate in save_state