added function to obtain instance state
Merge branch 'stage_statechange'