Dynamically add active class to navigation links