updated function to set globals that are used accross the cmds