fixed variable issue in version 2