fixed a bug in enabling the OK button