Adding type check.