change protocol to make it consistent with server side and c++ version