Now background is working but the intervals are undefined