autoload db
handle error case