Add different error handlings.