fixes bug in save button