added weights update