fixed bug in SetEntity command