bugfix - correct index in form_state