Can you please move this check so that it's right below the `isinstance` check? We want the least expensive checks to go first so it can bail as quickly as possible.