fixed variable name in finish()