add code for type checking.