Allegri: Milan had to change