monkey patch race condition - need better fix