Steps to reproduce: 1. Enter the Login 2. When being asked to enter an email, input "rho@gMail.com" or any others that did not comply with the naming rules of the email Actual result: The software prompt "Account doesn't exist. Would you like to register one?[Y/N]" Expected result: The software prompt "Please input a correct email address!", then process to ask the user to input an email again Solution: Add String pattern = "[a-zA-Z0-9_-]+@gmail.com$"; & !Pattern.matches(pattern, inpEmail) to login() to verify if the email has the correct name .