Fixed the closing of regions