fixed bug in intervals