fix in save function