limit buffer to 1024