prevent saving undefined value; fixes #13