fixed castling bug