Checking of instance object instead of checking class name

Of course, it's better