fix expand fail and follow the official function update