fix code to pass shellcheck