better long cwd handling