change try-catch range in getNextDataPair