prevent setResult be called twice