Modified okButton to check a required fields