fix(lp): fixing a memory handling bug