fix stupid bug qid off by 1