fixed bugs and made the email unique