Handling the data stream