fix code based on pull request review