Implement, but it occures segmentation fault