corrected the beamcode lookup function return value