Thermal isomerization of substituted allylpyrroles