checking if class exists before declaring the class