add debug mode to stop GUI calls in text version