Make closeOnLocationChange optional