make sure type is correct in entity decl