added tests for callbacks and buffering