fixed last variable issue