add lastkey lastevent and cleareventkey to fetch the very last state and key