modified js method to reflect html class changes