Fixed nesting setInterval bug