updated check_mongodb_write.pl