Fix Null Reference issue