fixed problem with creating relation when parent has not relations