fixed setting of variables