What Roger said...........
In simple terms from my view -
Where I sail, and in most places, the wind and waves aren't at 90 degrees to one another. This makes you think you have the board perpendicular to the wind, but you don't, it is actually pointing into the wind or bearing off. You probably find that your heading up problem is generally occurs when you are on starboard or port, but not both. Sheeting in the sail to gain power will instantly head you up into the wind.
Usually when sheeting in, you will add weight to the back foot, which just makes the problem worse.
If you begin the whole thing by being sure that the board is heading 100 - 110 degrees off the wind, it should go fine.