condition checks for both empty strings and empty arrays