guard against empty input