Reverts the infinite event loop in the previous commit