fix weights update