fixed issues connnecting to db