fixed memleak in database::load()