adding class to data element and fixing the logic for multiple menu items