There could be a couple of issues that create a nasty odor. Both are easy to fix though.
1. Too much "green" matter. If too much kitchen scraps, yard trimmings, etc. are added to the pile, odors can occur. To fix this issue, add shredded paper or other "brown" materials to balance out the green to brown ratio.
2. Too much moisture in combination with not enough rotating. I've run into this before even with a good brown/green ratio. To fix, just rotate your compost more often. Rotating releases excess moisture and helps beneficial bacteria establish. Sometimes too much moisture creates anaerobic conditions, helping those nasty bacteria create some funky smells.
Good luck to you.