caching of databases looks fishy, at least use absolute paths