fixed buffering bug, moved the buffering to a new thread.