Fixed Null Pointer exception