fixed loss of variables