fixed castling glitch