fixed a very stupid bug in core_add_char