only change path if needed