removed unused vars
fixing update issues