Move proxy link modification code

The code was not inside the document ready handler, so it wasn't running.