adding test for onerror better behavior