complete short url function