Use chpwd_functions to avoid modifying chpwd