Twitter CEO Jack Dorsey said Wednesday that he is planning on apologizing to the McCain family after the social media platform took hours to remove a threatening image featuring Meghan McCain shortly after her father's death, he told a congressional committee on Wednesday. Last week, McCain's husband Ben Domenech slammed the company after a doctored image showing a gun pointed at her remained up for hours.

"We did take way too many hours to act, and we are using that as a lesson to help improve our systems," Dorsey said.

A user posted the image of McCain overcome with emotion at her father's casket and overlaid an image of a gun pointed at her. The tweet said "America, this ones for you." The account was suspended after Domenech tweeted a screenshot of the threat.

Get Breaking News Delivered to Your Inbox

Appearing before the House Energy and Commerce Committee Wednesday, Dorsey said the offending tweet was up for "five hours," although Domenech tweeted Saturday that the image had been up for "half a day" and he had to "raise a ruckus" before it was deleted.

"It is definitely a violation and we were slow to act," Dorsey said.

Dorsey said that while he hasn't apologized to Meghan McCain or her family, he plans to. He acknowledged that the company's systems currently place the burden of reporting threats on the victim, but said Twitter is committed to "build algorithms to proactively look for when these things are occurring and take action."