Fetch repository correctly