Adding conditional active class to buttons