fixed bug in collectlinebuffers