Updated class convert to fix bugs