added function to obtain instance state