The strings of a violin (or any other string instrument) are held in tune because of the tension on the peg going into the peg box. When the
pegs do not fit tightly into the peg box the strings can slip causing the instrument to go out of tune. This is particularly a problem on newer instruments. Fortunately the solution is very easy. Peg Dope is a product that can be applied to the tip of the peg to create additional friction and stop strings from slipping.
Buy Peg Dope from Amazon.com