fix bug on families management

Fixed https://forge.indepnet.net/issues/4986
Fixed https://forge.indepnet.net/issues/5020