Adding undo redo functionality in MyApplication.