fix new_character seg fault bug