WIP: don't mutate in case of error