castling bug fixed