added todo state sorting