fixed db handling on localhost