fixed ugly variable assignment