fixed give hint bug and redo / undo