layout patching