fix racing condition in context/reactor methods