handling of empty input and output