fixed bug: use pointer to queue instead of copy
fixed bug: stream->data pointing to unknown integer