saved query in a varible out loop