add typecheck for io