only remove last element of the alist if it is nil.