added gettargetfield errorhandling