Small bug fix in validate handler.