Updated character entity check