modify logic for new framework