remove invalid error when constructing generics