Fixes cancel rendering regression

Fixes #4723