fixed bug in PieceProtocol