fixed require bugs, make db save to doubleAgent