updated c3 to handle errors