attempting to fix seg fault