currently brutally hacked to work with standalone and normal mode, need a better implementation