Modify staging code for Flexpath to avoid bug