Resolve error where parsed_url was being referenced but not declared

`parsed_url` was being used in a function call yet the variable did not exist.  Additionally, the function being called was getting referenced before it was declared.