fixed bug on castling