Adding type checking of generic for