add state.time and remove parsing from on_cmd hook