make gen-character more robust