Use .closest('li') instead of .parents('li').first()