added conditional compiling for gui