the try block has to be moved one level up, the loop itself could throw an exception already and that will lead to an forced/unclean application shutdown