changed the way that the command stack is processed