Fixed Null Pointer in main.