fixed bug with finishing a stream, first test now works