handle no data on stdin gracefully