fixes #1142
null check for loaded values
fixed test to use test instance factory
Merge pull request #1144 from enesakar/master-issue1142

fixes #1142