fix remove unreferenced variables