added query to state