Updated js (JSON) and set_userstate.php