Gender Mistaken?

Has anybody done an early ultrsound where they tell you the gender and you do another one where your around 6-7 MO and gender has changed? If so can someone explain why does that happen? Thanks