Just two days after Hulu announced that The Mindy Project will end its run after one more season, the series’ male star Ed Weeks has been tapped to lead the ensemble of Fox’s comedy pilot LA -> Vegas, from Gary Sanchez Prods.

Weeks will star opposite Dylan McDermott and Kim Matula in the pilot, written by Lon Zimmet and directed by Steve Levitan. The casting for the role came down to the wire, with the table read for the pilot postponed for two days until Weeks was locked in. He also will return for the final chapter of The Mindy Project, which started on Fox before moving to Hulu after three seasons.

LA -> Vegas is an ensemble workplace comedy set on the Friday night flight from LAX to Las Vegas and the returning flight on Sunday. It is about a group of underdogs trying to find their place in the world who all share the same goal: to come back a winner in the casino of life.

Weeks will play Micah, an accountant and regular on the flight between Los Angeles and Las Vegas, where he visits his family on weekends. Plagued by more than a few demons, he’s a recovering alcoholic/gambler/sex addict who is separated from his wife. As people who have both made a lot of mistakes in their past, he and head flight attendant Ronnie (Matula) have a strong connection. McDermott plays the flight’s pilot.

Weeks, who plays the hapless OB/GYN Jeremiah “Jeremy” Reed on The Mindy Project, is repped by WME, Morris Yorn and United Agents in the UK.