implement receive stdin feature