fix write-snps.py bug