seg fault resolved