fix dirty value

remove the temporary variable, then use the member variable.