Michael Avenatti told a Manhattan federal jury on Wednesday that he had a “good faith” belief he was entitled to $300,000 that he is now accused of stealing from his former client, adult film star Stormy Daniels.

In a nearly 90-minute closing argument, Avenatti ended an eight-day trial on wire fraud and aggravated identity-theft charges by recounting the work he did on Daniels’ behalf—from editing parts of her book to representing her in a high-profile legal dispute with former President Donald Trump—to argue that he was owed the money under a February 2018 contract.