small code changes in entity det