repair a bug

a bug caused by invalid temporary variable