added alternative way to connect to db