added cd-wrapper function