fixed declaration of variables