add lookup revised so invalid paths are handled