Most probably you've got OCD machn. http://askmydoctor.lk/other/ocd/
Just don't keep worrying ! YOU MUST SEE A DOCTOR (A Psychologist)
I too have OCD and I went to see a doctor and he helped me by explaining things. Now you may think "it just doesn't work". No man, It really works, worked for...