guard against empty sequence