add redo and undo button
fix a bug for auto layout