Fixed order array issue

and added validation to column IDs