fixing initialization of variables