combining the try blocks