Added email validation and input sanitization to the index page.