fixed validate bug