Added typecheck for scan