fix a bug when genering king's moves