Added active menu detection