add code for script turn on debug or not.