fix seg fault if data type is csv