bug fix: dir start and dir end values go to the command stack even if they are incorrect