Fastner Question

Had a castleated nut loosen on a dirt bike shock. Cleaned it up and used thread locker. Came loose again. This time- tightened the nut, drilled hole through the bolt and put a cotter pin in it. Never cam loose again. Nothing more positive than a cotter pin.