```\n  function cancel(uint256 proposalId) external {\n    if(_getProposalState(proposalId) == ProposalState.Executed) revert InvalidProposalState();\n    Proposal storage proposal = proposals[proposalId];\n    if(msg.sender != proposal.proposer) revert NotProposer();\n    if(GovLocks(govlocks).getPriorVotes(proposal.proposer, block.number - 1) > proposalThreshold) revert AboveThreshold(); //@audit incorrect\n    proposal.cancelled = true;\n    uint256 targetsLength = proposal.targets.length;\n    for (uint256 i = 0; i < targetsLength; i++) {\n      Timelock(timelock).cancelTransaction(proposal.targets[i], proposal.eta, proposal.values[i], proposal.calldatas[i], proposal.signatures[i]);\n    }\n    emit ProposalCanceled(proposalId);\n  }\n```\n