modified to not use deprecate method. added to null processing.