Thoughts created by our emotions and deeds always keep us negatively occupied we are never at peace to attain the blissful state of mind that we are supposed (born) to be in. This makes one thing clear that meditation means slowing down the thought process and ultimately completely stopping it. Therefore when you start meditation you are bound to have thoughts.
What you do is stop reacting to them.Be an observer. Energy flows where mind goes. When you stop reacting to them you basically stop feeding them energy and you do not let them gain power. When you continue to practice it they will become weak and stop bothering you.