better delay undo stack by using threading module