fixed#2 query db for pending 'state' event