fixed variable name bugs --KW