properly escape URI when submitting results

also made small improvement (?) to logic for determining working path
haha, I'm an idiot