fix NPE when using compound FKs, this will require correct implementation for these cases