fixed a bug in protocol