Here is the section that adds the records.
Check above it, I bet it is erroring out.
Considering you're getting the import, it tells me it has to be one of these three items.
So, either the error is with the alerting (which since that is in a new thread, I don't think that's it)
The error is...