Added a entity validation check