added the db connect func