fix Spaghetti code in lk