fix bug using interval variable