fixed bug with castling