fixing variable issue