fix undefined chars when no char is matched