fixing lpstate.c and previous checkin