return errors instead of passing around errors array