fix the listing of subdirs that have spaces by encoding URI only once