If you just bought it from a dealer then call them ASAP. Tell them what it is doing. I am sure they will take care of it if you let them know right away. If you wait and try working on it yourself they may not be so helpful.
94 318I, 96 740IL, 97 528I, 07 335I