Nearby Cycles And The Cohomology Of Shtukas