fixes berkeley db calls
fixes lookups