entry should be deleted before the function ends.