The 5th Division was out of action for some months. It finally moved with the rest of the I Anzac Corps to the Somme sector in October. After months of fighting and recent rain, the front line area was a devastated muddy morass. McCay was ordered to undertake an attack with the 2nd Division's 7th Infantry Brigade at Flers, which cost 819 casualties and gained no ground. Once again, McCay's handling of his division showed poor planning and tactics. Moreover, at Flers he showed that he had not learned from the lessons of Fromelles. His relief was now only a matter of time. Nonetheless, McCay remained in command of the 5th Division until 18 December 1916 when he was granted medical leave in the United Kingdom for treatment on his leg, which the doctors diagnosed as neuralgia. Birdwood took the opportunity of removing McCay, ostensibly on medical grounds. McCay was mentioned in despatches a third time.