use fix_target_path in cd function to prevent OSError exceptions in pam