added finally blocks