proposed fix for github issue #8: error property now set on main thread; complete is idempotent by ignoring subsequent calls.