[FIX] fix code corresponding to comments in pull request