add avatar states and set_state function