fixed a bug in save button