fixed changes as per last pull request. added sending batch events