fix validation query