fix entities with new database design