In Votan's Achievement Overview I have a scan, too.
Your code looks similar. I don't know if there is a difference without debugging.
I can remember that I had the same problem. And I think the code in there is working.
Feel free to use it
Or just have a look at.