guarding JS against empty todo lists