fixed the lw and sw  issues ya7ya reported