improved primary member check