fix bugs with the reactor introduced by the refactoring earlier