fix bug in interval