tried to fix a seg fault