[UPDATE] minor update to secure __set_state