refactoring: moved toggle debug mode by url to debug.js