For deleting when only one element remain in list

the app used to crash when the single element was deleted because of the setAlarms function not getting any content. So we create a logic not to call that function when we delete the last element left in the list