Seg fault solved