fix bug with interval generation