For a Divorce to be correct, it has to have the following conditions:
1- You have to have two believing adults as your witness
2- The woman has to be clean of her menstrual period and also shouldn't be pregnant
3- Proper Arabic words need to be uttered for the act to take place.
If the above mentioned conditions were met then the nikah is invalid as divorce had taken place, otherwise it is still valid.