Fixed undo move on GUI

Added the undo last move statement call to an if statement so that if it
does not complete properly, nothing will happen on the gui.