made changes to move one time used variables into error catching if statement
made changes to move one time used variables into error catching if statement

thomaso-mirodin/go-shorten,didip/shawty,thomaso-mirodin/go-shorten,thomaso-mirodin/go-shorten