A novel thermal controlled optical attenuator