Psalms 119:67

Before I was afflicted I went astray: but now have I kept thy word.