added select table lookup function