Added function for handling button to scan for beacons and timeout after specified time