changed to exclude interval end time