switched the filter function to use statically allocated I/O buffer