Simplified condition to add active class on menu