StackOverflow exception in FirebaseDatabase RxJava2 extension

I am writing an RxJava extension to FirebaseDatabase, but sadly whenever i run this code, i get a stackOverflow exception at the line indicated in the code by the comment. Help please and thanks in advance.

Flowable<Success> addDish(Dish dish, boolean upload) {
    DatabaseReference newDishRef = databaseReference.push();
    dish.setId(newDishRef.getKey());
    return Flowable.create( 
            e -> newDishRef.setValue(dish) // StackOverFlow Exception here
                    .addOnSuccessListener(
                            aVoid -> e.onNext(upload ? new Success(dish.getMenuImage()) : new Success()))
                    .addOnCompleteListener(task -> e.onComplete()).addOnFailureListener(e::onError),
            BackpressureStrategy.BUFFER);
}

Stack Trace:

io.reactivex.exceptions.UndeliverableException: 

java.lang.StackOverflowError: stack size 1036KB
08-17 17:59:07.207 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:349)
08-17 17:59:07.207 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:64)
08-17 17:59:07.207 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
08-17 17:59:07.208 12744-13103/com.nowait.menu.admin W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
08-17 17:59:07.208 12744-13103/com.nowait.menu.admin W/System.err:     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
08-17 17:59:07.208 12744-13103/com.nowait.menu.admin W/System.err:     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
08-17 17:59:07.208 12744-13103/com.nowait.menu.admin W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
08-17 17:59:07.208 12744-13103/com.nowait.menu.admin W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
08-17 17:59:07.208 12744-13103/com.nowait.menu.admin W/System.err:     at java.lang.Thread.run(Thread.java:818)
08-17 17:59:07.208 12744-13103/com.nowait.menu.admin W/System.err: Caused by: java.lang.StackOverflowError: stack size 1036KB
08-17 17:59:07.223 12744-13103/com.nowait.menu.admin W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
08-17 17:59:07.223 12744-13103/com.nowait.menu.admin W/System.err:     at java.lang.reflect.Method.invoke(Method.java:372)
08-17 17:59:07.223 12744-13103/com.nowait.menu.admin W/System.err:     at com.google.android.gms.internal.zh.zzas(Unknown Source)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at com.google.android.gms.internal.zg.zzan(Unknown Source) //  there was a million of those
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at com.google.firebase.database.DatabaseReference.zza(Unknown Source)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at com.google.firebase.database.DatabaseReference.setValue(Unknown Source)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at com.nowait.menu.admin.screens.menu.detail.EditDishVM.lambda$addDish$5(EditDishVM.java:67)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at com.nowait.menu.admin.screens.menu.detail.EditDishVM$$Lambda$5.subscribe(Unknown Source)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:72)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.Flowable.subscribe(Flowable.java:12986)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.Flowable.subscribe(Flowable.java:12932)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.operators.flowable.FlowableScalarXMap$ScalarXMapFlowable.subscribeActual(FlowableScalarXMap.java:160)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.Flowable.subscribe(Flowable.java:12986)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:38)
08-17 17:59:07.334 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.Flowable.subscribe(Flowable.java:12986)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.operators.flowable.FlowableOnErrorReturn.subscribeActual(FlowableOnErrorReturn.java:33)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.Flowable.subscribe(Flowable.java:12986)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.Flowable.subscribe(Flowable.java:12932)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.operators.flowable.FlowableConcatArray$ConcatArraySubscriber.onComplete(FlowableConcatArray.java:139)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.operators.flowable.FlowableConcatArray.subscribeActual(FlowableConcatArray.java:40)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.Flowable.subscribe(Flowable.java:12986)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.Flowable.subscribe(Flowable.java:12932)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:163)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.runAsync(FlowableObserveOn.java:400)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:     at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
08-17 17:59:07.335 12744-13103/com.nowait.menu.admin W/System.err:  ... 7 more

So i figured out that in my model i had getter that parses a string url to a URI object and thats why it was crashing