Fixed searching infinitely for extends