fixed bug with saving