make valid() stronger in mozilla format