updated frameActionSwitcher to include a onExit optional parameter for functions