fixed issue where empty data was aborting SQL_writer