fixed memory problems caused by lp class