Fix beacon code