begining of database connection