fix bug with characters at beginning of string