Fix state publisher, the code commited previously would not work.