 The song was performed in the Britney Spears @-@ themed episode " Britney / Brittany " of the US television series Glee , which aired September 28 , 2010 . Lea Michele , in character as Rachel Berry , sang the song at the end of the episode as an apology to her boyfriend Finn Hudson , played by Cory Monteith . The performance was praised by most critics , with Rolling Stone 's Erica Futterman calling it " gorgeous and tender " and Entertainment Weekly 's Tim Stack praising it as the episode 's " nice , emotional capper " . Williams complimented Michele 's vocals on the rendition through her Twitter account . The cover was released as a single and charted at number twenty @-@ two in both Canada and Ireland , twenty @-@ six in the US , and sixty in Australia , with sales of 89 @,@ 000 copies in the US according to Nielsen SoundScan . 
