There is a difference between feeling gratitude and appreciation for something, and feeling attachment to something. Appreciation and gratitude are states of pure love, while attachment contains fear - fear of losing or not having what you are attached to. When it comes to something you want in your life, appreciation and gratitude attracts, and attachment pushes away. If you are feeling afraid that you will not get what you want, or losing what you have, then you have attachment.
To remove the attachment, keep shifting yourself into a state of appreciation and gratitude, until you can feel that the fear has gone.
Each of us is attracting in every moment of our lives. So when you feel that the law isn't working for you because you don't have what you want, realize that the law is responding to you. You are either attracting what you want or you are attracting the absence of what you want.
The law is still working.