Issue #30 fix logic with null