early returning errors first