This is a query in a loop which is usually a no-go.