Android app crashing when offline using .initialSubscriptions in syncConfig

If initialSubscription is provided while network connectivity is cut off app freezes and eventually crashes after around 15 seconds.

SyncConfiguration config = new SyncConfiguration.Builder(GlobalParas.user.get())
                    .allowWritesOnUiThread(true)
                    .allowQueriesOnUiThread(true)
                    .initialSubscriptions(new SyncConfiguration.InitialFlexibleSyncSubscriptions() {
                        @Override
                        public void configure(Realm realm, MutableSubscriptionSet subscriptions) {
                            Subscription subSet = subscriptions.find("subscribeToCards");
                            System.out.println("subSet = " + subSet);
                            if(subSet == null) {
                                subscriptions.add(Subscription.create("subscribeToCards", realm.where(Card.class)));
                            }
                        }
                    })
                    .waitForInitialRemoteData()
                    .build();

On removing both initialSubscriptions and waitForInitialRemoteData app stops crashing.