add active class to clicked element and remove from previous element