add query methods to state machine instances