Chingyul,
It's not the shims, you need to tighten it up more. If it's difficult for you, get a barrel nut wrench. If it's difficult, use a longer wrench (either use a real m-16 armorer's wrench or if your barrel wrench has a 1/2" drive, attach a spanner to it with 1/2" drive); or clamp the upper receiver in a bench vise and re-attempt.
Either one of these will surely work but both of it will be much easier for you.
__________________

5.56x45mm + m27 = M249(SAW)
|