Prevent fatal error when adding/updating