modify extract url function