Fixed issue where the addClass method was failing