You have a race condition with `closeIfProceeds`. Put this sentence before `setOption` to ensure they are queued in the correct order.