PARK CITY, Utah (AP) — The Emma Thompson and Mindy Kaling comedy “Late Night” is already one of the biggest hits of the 2019 Sundance Film Festival with an acquisition price to match.

Amazon Studios on Saturday purchased the film in a U.S. distribution deal of $13 million, a record for the festival.

Kaling wrote the script for “Late Night,” which follows a veteran talk show host played by Thompson who’s facing declining ratings and a reputation for not liking women. Kaling plays the diversity hire in the writer’s room who shakes things up for the show.

Kaling says she wrote the part of Katherine Newbury for Thompson, having never met her. She laughs that she was just a creep in her home writing fan-fiction for the British actress, hoping that she wouldn’t read it.