Added buffering middleware