rewriting stack using source map info