bug fixing in lookup method

tests more tests