fixed some bugs with the king