Add some error handeling.