also, the scope of try/catch block should be bigger, to encompass all `putIfAbsent` calls.