fix onError undefined problems reported upstream