better state logging