Added ability to detect beacons in background.