does not explain why it works when debug is on, and not work when debug is off.... need a long term solution.