still working on seg fault issue