Putting the if-statement between the is_null check, because $classname isn't uses outside this is_null check