add size and error rescue