Fixing onError callback definition