type checking added