Fixed connection to db