add time selection logic