anchor.diff:        });
       });
   
  -    _isAdvertisingSubscription =
  -        beaconBroadcast.getAdvertisingStateChange().listen((isAdvertising) {
  -          setState(() {
  -            _isAdvertising = isAdvertising;
  -          });
  -        });
  +    beaconBroadcast.getAdvertisingStateChange().listen((isAdvertising) {
  +      setState(() {
  +        _isAdvertising = isAdvertising;
  +      });
  +    });
  +    
  +    //uuidTimer = Timer.periodic(Duration(seconds: 1), (Timer t) => changeUUID());
  +  }
  +
  +  @override
  +  void dispose() async {
  +    super.dispose();
  +
  +    SharedPreferences prefs = await SharedPreferences.getInstance();
  +    prefs.setString('uuid', beaconUuid);
  +    //uuidTimer.cancel();
  +    print("Exit beacon");
  +  }
  +
  +  void checkTime () async {
  +    SharedPreferences prefs = await SharedPreferences.getInstance();
  +    beaconUuid = prefs.get('uuid') ?? "null";
  +    var previousTime =  prefs.get('previousTime') ?? DateTime(1990).toString();
  +    var difference = DateTime.now().difference(DateTime.parse(previousTime)).inSeconds;
  +    print(difference);
  +    if (difference > 10) {
  +      beaconUuid = Uuid().v4();
  +      prefs.setString('previousTime', DateTime.now().toString());
  +    }
  +
     }
   
     void startBroadcast () {
  
positive.code: import 'package:flutter/material.dart';
  import 'package:beacon_broadcast/beacon_broadcast.dart';
  import 'package:uuid/uuid.dart';
  
  class BeaconView extends StatefulWidget {
    @override
  
negative.code: class _BeaconViewState extends State<BeaconView> {
  
    var _isTransmissionSupported;
    var _isAdvertising;
    String broadcastingState = "Currently not broadcasting";
    BeaconBroadcast beaconBroadcast;
    var beaconUuid = 'null';
    Duration uuidDuration;
    var uuidTimer;
  
    @override
    void initState () {
      super.initState();
      print("Enter beacon");
  
      checkTime();
      beaconBroadcast = BeaconBroadcast();
      beaconBroadcast.checkTransmissionSupported().then((isTransmissionSupported) {
        setState(() {
  