dynamic count of refs in LSP