fix error in save function that was causing success and error handlers
not to be called
test (I am having trouble getting the tests to run on my machine so
can't be sure the test is correct)