update onerror behavior