exit when type mismatch ocurrs