fixed prepare databases in router