bug fixes in protocol