If I create entity

ent_ptr=ent_create("ball.mdl",Pos,Ent_Action);

and then in the action I have for example

action Ent_Action()
while(1)
{
if(me.z<100)
ent_remove(me);
wait(1);
}

Shouldn't above function remove entity ok? I cannot get it work? Any ideas