Why mandatory field is not working?