remove unused onError function