bugfix for no end command in global mode.