handle multiple onError calls