Adapted to the latest interval API changes