Updated OK button logic.