fixed an error thrown when trying to save if there are errors

refs SPOT-751