added controllers to debug.html, tried to fix the problems