Added code to save regions