add beforeInitData support