fix for generic

1.fix for generic type
2.clean unused import