Why required fields are not working?