prepare: exit 1 if fails