fixed variable names and thread name