Added the try/finally and moved this refresh enabling code.