slight changes to fix segmentation fault