fix get_by_time_and_state api