defined main_state