corrected error in wrinting of region files, add curly brackets in write