add checkNull and lastMove in UpdateUI