added function for initialize_state_source