improved the addclass compatibility