work on type checking