fixed some variable declarations that were causing problems in creating the URI