fix bug in lastMove fn