seg fault but fixed #10