bad attempt at writing queries for #4244
closes #4245