fixed null Pointer exception