resolve Null Reference exception