Need to adjust order of queries