Url writing fix

Please review @schilit