DF# fixed problem with NPE and code refactor
DF# fixed problem with NPE and code refactor