Revert race condition introduced in #420, close #463