bug fix in validateorder