fix condition in entity