fix seg fault crashes in elastic