Fixing nid existence check to use isset