small fixes
attempt to handle status:state in query and build the right logic