check return value of stream_select