Removed extra ply in search in case of check because it made ocasionally the program crash