Issue with implementation of COPY command