fix bug with int in weights