modified BeaconApplication.cpp