added sanity checks before adding generics