modified server to read the buffer