added method to check if class exists