clean code
Fix Segament fault