seg fault found, need to figure how to fix it