Fixed an issue with dupplicate states