update script, added state for select