Was writing out target URL incorrectly