add utils method to handle errs