fix NPE that could occur using COPY FROM