establishing connection to DB