Added the function to check if the email given already exists. Still need to check.