bound getId to lua
fixed entity deletion