added better detection for checking if a path exists after a wall placement