add state implementation