Adding type checking