Fixed Null Ptr Exeption and Generics