fix issues in ProtocolManager parse method