How to avoid clearing of the form state? I want to add form field based on data provided in submit handler. I am using $form_state for the job. I have done similar in the past but now it's just not work

Form code:

function module_form($form_state) {
 if (isset($form_state['module']['data'])) {
   //add field
 }
}

function module_form_submit($form, &amp;$form_state) {
  $form_state['no_redirect'] = TRUE;
  $form_state['rebuild'] = TRUE;
  unset($form_state['redirect']);
  $form_state['module']['data'] = module_get_data($some_value);
}


Inside module_form $form_state is always empty...
This:

function module_form($form_state) {


needs to be changed to this:

function module_form($form, &amp;$form_state) {


The function sig for forms changed in Drupal 7 to the second example above.