rewriter not fully working although app works from a specific 'happy path' approach