tweak: check variables before use
fix: _editRecord call