fix recursive functions, add saving script path