arg[0] must be "debug" to enable debug mode