changed debug to debugmode