fix for purging entities