fixed nested fk bug