added char detection to avoid Mongo crapping itself