fix JS response buffer