Everything working occasional seg fault