Revert to isinstance check