added more code for beacon detection