fix bug of code