working for 8 hrs. moved print() out of buffer-callback