cannot change mesh with modifiers present: Editable Mesh -- max script help needed !

hi and thanks for reading !

i am still a beginner and trying to figure out the max script language ... right now i am having some difficulties delete faces from an editable mesh...

the code does not make any sense .. but that does not matter .. i just need to know how to delete certain faces ... thanks alot !

the error message i get is : --runtime error: cannot change mesh with modifiers present: Editable Mesh

maybe anybody can help me out here the code(the error occurs while trying to delete :

macroScript Baumreduktion category:"abaumreduktion"
(
rollout bam "bams"
(
group "count group"
(
button blat "Blatreducer"
)

on blat pressed do
(
global temp = $pru1c3Leaf16
global i = getNumFaces temp

--select temp.faces[#{17234}]

delete temp.faces[#{17234}]
)

)

createDialog bam

)