Now when writing to stream finished we just write -1 to the end of the queue also name variable properly

Now when only positive numbers can be written to a stream we can safely
write -1 which will indicate the end of stream