change queries to for