fixed memory leak on input parameters