added error handling and persistant short url