Fix bug in save