made changes to allow save() calls inside ondelta methods, added tests