Fixing debug mode issue