fix segametaion fault, should no be 0