fixed url encoding for complex targets