Seg fault when the destructor is called and reimplementing email validation