checks to prevent taking suicide moves