clear_state function

Clear state object