support generics in stack implementation