completed migrate to be compatible with old demo