Checking of instance object instead of checking class name