Added: Conditional statement to check if the class exists