add type checking.