Adding URLEncoder to handle resoruces with spaces in their names