corrected segfautl