Dealt with null value issues