Added some null checking to prevent empty return to DT