fixed connection to db