collect data from onData event and parse it onEnd