fix onerror BUG