writing resource URL, minor bug fixes