Added check for duplicate email and username