Fixed the for using the wrong InvocationTargetException