add logic for checking email existed