updated initialize_state to use initialize_state_source