safeguard against empty strings