move errors.clear call