fix onerror error