added logs and undo