Solved a bug relating to infinite wait on new data