Delta shower hammaring

Hello, I replaced a delta shower cartridge on my single handle shower to stop a leak. The leak stopped but now when I turn the sink off or the toilet shuts off after a flush, I can hear hammering coming from the shower. There was some rust colored water coming out of the faucet after turning the water back on. So there might be sediment in the pipes. I even tried putting the original one back in with the springs and rubber seals from the new cartridge. Its the 1300 and 1400 series cartridge. Any ideas how to stop the hammering and knocking?

I fixed it. After reading a similar post about the same problem here, I looked at the valve I bought and it was a danco. I replaced it with a delta original part and the knocking went away. Danco = JUNK. You guys know your parts here thanks.