There are some bugs in save function