Undo with autoscheduling and custom lightbox

Hi,

I would like to have autoschedule functionality along with a custom lightbox. So in the save method I have added gantt.autoschedule(taskId). It works fine.
When I try to undo the changes the dependent tasks changes get undone but root task changes don’t get reverted.

Could you pls help me with the same.
Thanks in advance.