Move this inside the check for mode name.