try using ent_remove instead of ptr_remove