Add get_state method