resolving #167 Null Pointer exception when using GUI