Move query validation up in the command process