fix getcwd() issue