Added dynamic active menu item logic