connecting to the database