added a debug mode in the gui