Added undodir option