Fix error where the column is not accessed. Having it outside the try is fine because the catch in this case also requires an active connection. So an exception would be thrown to the caller either way if the db connection is closed.