bug fix. assign variable qn