fix for getcwd() problem