Moved the Logger into the try to get the IndexOutOfBound Exception if there is one