Fixed bug in protocol