add onerror listeners