added the support of beacons in app.js