Updated error handlings.