fix rolling back a patched layer