Added check for username, password and email, and an alert dialog