fixing errors related to missing variables