Add state_machine to Pq