handle the case when stdin is empty