Corrected code to select the active region of the navigation menu