We have many validity checks for different queries. It's better to put them together and check the validity first.