Added a detection of end of round