fixed bad query ref