fixed creation of db connections