Fix crash when showing edits or records