lookup function for qhash