product more robust against empty input