Connecting to the database