Added validation for checking weights assignment