fix isinstance check