return err if there was any