revert order of script flow