debug mode is mostly working